#忘忧泉练习函数53hangcuowu
def make_pizza (size, *toppings):
    print(f"\nMaking a {size}-inch pizza with the following toppings:")
    for topping in toppings:
        print(f"- {topping}")
import pizza

pizza.make_pizza(16,'pepperoni')
pizza.make_pizza(12,'mushrooms','green peppers','extra cheese')

import pizza as p

p.make_pizza(16,'简化版的pepperoni')
p.make_pizza(12,'prerafying3mushrooms','green peppers','extra cheese')
#有Dog类
#lei
class Dog:
    """一次模拟小狗的简单尝试。"""

    def __init__(self, name, age):
        """初始化属性name和age。"""
        self.name = name
        self.age = age

    def sit(self):
        """模拟小狗收到命令时蹲下。"""
        print(f"{self.name} is now sitting.")

    def roll_over(self):
        """模拟小狗收到命令时打滚。"""
        print(f"{self.name} rolled over!")
my_dog = Dog('Buddy', 5)
# 输出小狗的名字
print(f"My dog's name is {my_dog.name}.")
# 输出小狗的年龄
print(f"My dog is {my_dog.age} years old.")
# 调用sit方法，模拟小狗蹲下
my_dog.sit()
# 调用roll_over方法，模拟小狗打滚,:
my_dog.roll_over()
class Dog:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def sit(self):
        print(f"{self.name} is now sitting.\n")


my_dog = Dog('Willie', 6)
your_dog = Dog('Lucy', 3)

print(f"\nMy dog's name is {my_dog.name}.")
print(f"My dog is {my_dog.age} years old.")
my_dog.sit()

print(f"\nYour dog's name is {your_dog.name}.")
print(f"Your dog is {your_dog.age} years old.")
your_dog.sit()

